package com.imooc.pay.enums;

public enum PayPlatformEnums {

    WX(1,"微信支付平台"),
    ALiPAY(2,"支付宝支付平台");

    private int index;
    private String info;

    PayPlatformEnums(int index, String info) {
        this.index = index;
        this.info = info;
    }

    public static PayPlatformEnums getPayPlatformNumber(int platformNumber) {
        for (PayPlatformEnums platform : PayPlatformEnums.values()) {
            if (platform.getIndex() == platformNumber) {
                return platform;
            }
        }
        throw new RuntimeException("未知的支付平台");
    }

    public int getIndex() {
        return index;
    }

    public String getInfo() {
        return info;
    }
}
